package com.atguigu.tingshu.album.config;


import com.qcloud.vod.VodUploadClient;
import com.tencentcloudapi.common.Credential;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
@ConfigurationProperties(prefix="vod") //读取节点
@Data
public class VodConstantProperties {

    // 腾讯云点播(VOD)服务的应用ID
        private Integer appId;

        // 腾讯云API访问密钥ID，用于身份验证
        private String secretId;

        // 腾讯云API访问密钥，用于身份验证
        private String secretKey;

        // 腾讯云点播服务的地域配置
        // 参考官方文档：https://cloud.tencent.com/document/api/266/31756#.E5.9C.B0.E5.9F.9F.E5.88.97.E8.A1.A8
        private String region;

        // 视频上传后的默认媒体处理流程名称
        private String procedure;

        // 文件处理过程中使用的临时存储路径
        private String tempPath;

        // 视频播放时使用的鉴权密钥
        private String playKey;

    /***
     * 用于文件上传的客户端对象
     * @return
     */
    @Bean
    public VodUploadClient vodUploadClient() {
        return new VodUploadClient(secretId, secretKey);
    }

    /***
     * 平台点播对象
     * @return
     */
    @Bean
    @Primary
    public Credential credential() {
        return new Credential(secretId, secretKey);
    }



}
